#!/usr/bin/env python

import args_parser
import os.path
import time
import lts
import sys
import os

if __name__ == '__main__':
	# Parseo los argumentos de entrada.
	parsed_args = args_parser.parse(sys.argv[1:],2,3)
	system = parsed_args["system"]
	sync_set = parsed_args["sync_set"]
	graphic = parsed_args["graphic"]
	if len(system) == 1:
		print "\nIt needs at least tow systems!\n"
		sys.exit(0)
	result = system.pop(0)
	while system:
		result = result.sync(system.pop(0), sync_set)
	lts.to_file(result)
	if graphic:
		lts.graph(result.name)
